comparison libmpdemux/demux_audio.c @ 34184:da679f8d2ac6

Ensure that demuxer->movi_end will be set. This also simplifies the code that checks for TAG.
author ib
date Thu, 27 Oct 2011 19:58:42 +0000
parents 4cd3a8a22748
children 05306b88b675
comparison
equal deleted inserted replaced
34183:3053e7ffd08d 34184:da679f8d2ac6
330 330
331 switch(frmt) { 331 switch(frmt) {
332 case MP3: 332 case MP3:
333 sh_audio->format = (mp3_found->mpa_layer < 3 ? 0x50 : 0x55); 333 sh_audio->format = (mp3_found->mpa_layer < 3 ? 0x50 : 0x55);
334 demuxer->movi_start = mp3_found->frame_pos; 334 demuxer->movi_start = mp3_found->frame_pos;
335 demuxer->movi_end = s->end_pos;
335 next_frame_pos = mp3_found->next_frame_pos; 336 next_frame_pos = mp3_found->next_frame_pos;
336 sh_audio->audio.dwSampleSize= 0; 337 sh_audio->audio.dwSampleSize= 0;
337 sh_audio->audio.dwScale = mp3_found->mpa_spf; 338 sh_audio->audio.dwScale = mp3_found->mpa_spf;
338 sh_audio->audio.dwRate = mp3_found->mp3_freq; 339 sh_audio->audio.dwRate = mp3_found->mp3_freq;
339 sh_audio->wf = malloc(sizeof(*sh_audio->wf)); 340 sh_audio->wf = malloc(sizeof(*sh_audio->wf));
350 if(s->end_pos && (s->flags & MP_STREAM_SEEK) == MP_STREAM_SEEK) { 351 if(s->end_pos && (s->flags & MP_STREAM_SEEK) == MP_STREAM_SEEK) {
351 char tag[4]; 352 char tag[4];
352 stream_seek(s,s->end_pos-128); 353 stream_seek(s,s->end_pos-128);
353 stream_read(s,tag,3); 354 stream_read(s,tag,3);
354 tag[3] = '\0'; 355 tag[3] = '\0';
355 if(strcmp(tag,"TAG")) 356 if(!strcmp(tag,"TAG")) {
356 demuxer->movi_end = s->end_pos;
357 else {
358 char buf[31]; 357 char buf[31];
359 uint8_t g; 358 uint8_t g;
360 demuxer->movi_end = stream_tell(s)-3; 359 demuxer->movi_end = stream_tell(s)-3;
361 stream_read(s,buf,30); 360 stream_read(s,buf,30);
362 buf[30] = '\0'; 361 buf[30] = '\0';