[FFmpeg-devel] [PATCH] fixup mpegts_get_pcr to be more reliable

elupus elupus
Wed Aug 27 21:15:23 CEST 2008


Hi, 

Here are a few patches i created while trying to figure out why a file
"locked" up in mpegts_get_pcr on seek. I don't seem to learn that patches
to the mpegts demuxer have a tendency to get lost in the void. Anyway...

0001:
The code for backwords pcr searching could never be reached, so remove it.

0002:
Respect the maximum stream position that the function is allowed to
process.

0003:
Make sure the return value of url_seek is respected

0004:
Reindent after the above

0005:
Make mpegts_get_pcr resync to stream if the position it is asked to look
for a timestamp isn't on a mpegts syncword.

----

The real issue I found out later is that this particlar stream doesn't
contain any packets with pid = pcr_pid, so it reads the whole file to
attempt to find a starting timestamp for av_gen_search. 

Are the pid's for the pcr supposed to be listed in PMT? I haven't checked
this yet, but i suspect the given pid isn't available in there either.
Maybe it should be reset to -1 if the pid isn't found?

Regards
Joakim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-remove-unused-code-in-mpegts_get_pcr.patch
Type: text/x-patch
Size: 1703 bytes
Desc: Attached file: 0001-remove-unused-code-in-mpegts_get_pcr.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080827/f1a4f7a8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-respect-the-maximum-position-mpegts_get_pcr-is-allow.patch
Type: text/x-patch
Size: 1483 bytes
Desc: Attached file: 0002-respect-the-maximum-position-mpegts_get_pcr-is-allow.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080827/f1a4f7a8/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-check-return-value-of-url_fseek-in-mpegts_get_pcr.patch
Type: text/x-patch
Size: 1118 bytes
Desc: Attached file: 0003-check-return-value-of-url_fseek-in-mpegts_get_pcr.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080827/f1a4f7a8/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-cosmetic-reindent-of-mpegts_get_pcr.patch
Type: text/x-patch
Size: 1792 bytes
Desc: Attached file: 0004-cosmetic-reindent-of-mpegts_get_pcr.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080827/f1a4f7a8/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-make-mpegts_get_pcr-resync-if-it-s-not-on-a-valid-mp.patch
Type: text/x-patch
Size: 1049 bytes
Desc: Attached file: 0005-make-mpegts_get_pcr-resync-if-it-s-not-on-a-valid-mp.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080827/f1a4f7a8/attachment-0004.bin>



More information about the ffmpeg-devel mailing list