Ticket #1271: mencoder_03_joint_av_eof.diff
| File mencoder_03_joint_av_eof.diff, 1.2 KB (added by , 17 years ago) |
|---|
-
mencoder.c
old new 1120 1120 1121 1121 if(sh_audio){ 1122 1122 // get audio: 1123 while(!sh_video || mux_a->timer-audio_preload<mux_v->timer ){1123 while(!sh_video || mux_a->timer-audio_preload<mux_v->timer || d_video->eof){ 1124 1124 float tottime; 1125 1125 int len=0; 1126 1126 … … 1201 1201 } 1202 1202 } 1203 1203 } 1204 if(len<=0) {1205 if(!sh_video) at_eof=1;1206 break; // EOF?1207 }1208 1204 muxer_write_chunk(mux_a,len,0x10, MP_NOPTS_VALUE, MP_NOPTS_VALUE); 1209 1205 if(!mux_a->h.dwSampleSize && mux_a->timer>0) 1210 1206 mux_a->wf->nAvgBytesPerSec=0.5f+(double)mux_a->size/mux_a->timer; // avg bps (VBR) … … 1217 1213 audiosamples++; 1218 1214 audiorate+= (GetTimerMS() - ptimer_start); 1219 1215 1216 if(d_audio->eof) { 1217 if(!sh_video) at_eof=1; 1218 break; 1219 } 1220 1220 } 1221 1221 } 1222 1222 … … 1228 1228 sh_video->timer+=frame_data.frame_time; 1229 1229 } 1230 1230 frame_data.frame_time /= playback_speed; 1231 if(frame_data.in_size<0){ at_eof=1; break; } 1231 if (d_video->eof) { 1232 if (!sh_audio || d_audio->eof) 1233 at_eof=1; 1234 continue; 1235 } 1232 1236 ++decoded_frameno; 1233 1237 1234 1238 v_timer_corr-=frame_data.frame_time-(float)mux_v->h.dwScale/mux_v->h.dwRate;
