1
0
Fork 0
forked from len0rd/rockbox

Remove unnecessary parameter (struct codec_api* ci) passed to libasf functions, and consequently remove the no-longer needed #ifdef in apps/codecs/libasf/asf.h

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25788 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Mohamed Tarek 2010-05-02 20:07:11 +00:00
parent 9a74223f7d
commit 2fa864b9e6
3 changed files with 10 additions and 10 deletions

View file

@ -49,7 +49,7 @@ static unsigned short get_short_le(void* buf)
0 : *(data) : get_short_le(data) : get_long_le(data)) 0 : *(data) : get_short_le(data) : get_long_le(data))
int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength, int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
asf_waveformatex_t* wfx, struct codec_api* ci) asf_waveformatex_t* wfx)
{ {
uint8_t tmp8, packet_flags, packet_property; uint8_t tmp8, packet_flags, packet_property;
int stream_id; int stream_id;
@ -291,7 +291,7 @@ int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
} }
int asf_get_timestamp(int *duration, struct codec_api* ci) int asf_get_timestamp(int *duration)
{ {
uint8_t tmp8, packet_flags, packet_property; uint8_t tmp8, packet_flags, packet_property;
int ec_length, opaque_data, ec_length_type; int ec_length, opaque_data, ec_length_type;

View file

@ -36,11 +36,11 @@ struct asf_waveformatex_s {
typedef struct asf_waveformatex_s asf_waveformatex_t; typedef struct asf_waveformatex_s asf_waveformatex_t;
/* Define the packet-specific functions only for codecs not for metadata parsers */ /* Define the packet-specific functions only for codecs not for metadata parsers */
#ifdef __CODECLIB_H__
int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength, int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
asf_waveformatex_t* wfx, struct codec_api* ci); asf_waveformatex_t* wfx);
int asf_get_timestamp(int *duration, struct codec_api* ci); int asf_get_timestamp(int *duration);
#endif
#endif /* _ASF_H */ #endif /* _ASF_H */

View file

@ -60,7 +60,7 @@ static int seek(int ms, asf_waveformatex_t* wfx)
count++; count++;
/*check the time stamp of our packet*/ /*check the time stamp of our packet*/
time = asf_get_timestamp(&duration, ci); time = asf_get_timestamp(&duration);
DEBUGF("seeked to %d ms with duration %d\n", time, duration); DEBUGF("seeked to %d ms with duration %d\n", time, duration);
if (time < 0) { if (time < 0) {
@ -68,7 +68,7 @@ static int seek(int ms, asf_waveformatex_t* wfx)
DEBUGF("UKNOWN SEEK ERROR\n"); DEBUGF("UKNOWN SEEK ERROR\n");
ci->seek_buffer(ci->id3->first_frame_offset+initial_packet*wfx->packet_size); ci->seek_buffer(ci->id3->first_frame_offset+initial_packet*wfx->packet_size);
/*seek failed so return time stamp of the initial packet*/ /*seek failed so return time stamp of the initial packet*/
return asf_get_timestamp(&duration, ci); return asf_get_timestamp(&duration);
} }
if ((time+duration>=ms && time<=ms) || count > 10) { if ((time+duration>=ms && time<=ms) || count > 10) {
@ -141,7 +141,7 @@ restart_track:
int packet_offset = (resume_offset - ci->id3->first_frame_offset) int packet_offset = (resume_offset - ci->id3->first_frame_offset)
% wfx.packet_size; % wfx.packet_size;
ci->seek_buffer(resume_offset - packet_offset); ci->seek_buffer(resume_offset - packet_offset);
elapsedtime = asf_get_timestamp(&i, ci); elapsedtime = asf_get_timestamp(&i);
ci->set_elapsed(elapsedtime); ci->set_elapsed(elapsedtime);
} }
else else
@ -190,7 +190,7 @@ restart_track:
} }
errcount = 0; errcount = 0;
new_packet: new_packet:
res = asf_read_packet(&audiobuf, &audiobufsize, &packetlength, &wfx, ci); res = asf_read_packet(&audiobuf, &audiobufsize, &packetlength, &wfx);
if (res < 0) { if (res < 0) {
/* We'll try to recover from a parse error a certain number of /* We'll try to recover from a parse error a certain number of