comparison libmpdemux/demux_lavf.c @ 21548:bf65ffcf0cdb

Set AVFMT_FLAG_GENPTS if -correct-pts is used. This should allow using -correct-pts (and thus filters which adjust pts or add frames) with dvd or other mpeg container files by specifying "-correct-pts -demuxer lavf -vc ffmpeg12". Might work with libmpeg2 decoder too but certainly not with internal demuxer. Using this flag isn't quite optimal as it can cause extra buffering of demuxed frames, but at least it's better than just failing until a more complex solution is implemented.
author uau
date Sun, 10 Dec 2006 00:50:38 +0000
parents 76f120c4e0f1
children 51a7cbc52102
comparison
equal deleted inserted replaced
21547:0e6c0cd3dfac 21548:bf65ffcf0cdb
194 stream_seek(demuxer->stream, 0); 194 stream_seek(demuxer->stream, 0);
195 195
196 register_protocol(&mp_protocol); 196 register_protocol(&mp_protocol);
197 197
198 avfc = av_alloc_format_context(); 198 avfc = av_alloc_format_context();
199
200 if (correct_pts)
201 avfc->flags |= AVFMT_FLAG_GENPTS;
202
199 ap.prealloced_context = 1; 203 ap.prealloced_context = 1;
200 if(opt_probesize) { 204 if(opt_probesize) {
201 double d = (double) opt_probesize; 205 double d = (double) opt_probesize;
202 opt = av_set_double(avfc, "probesize", opt_probesize); 206 opt = av_set_double(avfc, "probesize", opt_probesize);
203 if(!opt) mp_msg(MSGT_HEADER,MSGL_ERR, "demux_lavf, couldn't set option probesize to %.3f\r\n", d); 207 if(!opt) mp_msg(MSGT_HEADER,MSGL_ERR, "demux_lavf, couldn't set option probesize to %.3f\r\n", d);