[FFmpeg-devel] [PATCH] CrystalHD: Fix h264 1080i DVB stream decoding

Istvan Sebok sebok.istvan at gmail.com
Thu Apr 19 21:48:20 CEST 2012

I couldn't play DVB-T stream with mplayer. The video was very slow and I
got a "Input buffer full" error messages few seconds later. This patch fix
this problem. I can watch the TV on my netbook. My notes are
in chronological order:

1: copy_frame returned RET_OK permanently, because VDEC_FLAG_UNKNOWN_SRC
was set all cases.
     return priv->need_second_field &&
-           !(output->PicInfo.flags & VDEC_FLAG_UNKNOWN_SRC) ?
+           (output->PicInfo.flags & VDEC_FLAG_UNKNOWN_SRC) ?

2: This part is the goal. I don't have to wait for the second field,
because it is ready. I removed while(1){..} too. Disadvantage:  the
progressive frame decoding lates 1 frame.
     if (priv->output_ready < 2) {
-        if (decoder_status.ReadyListCount != 0)
+        if (decoder_status.ReadyListCount >= 2)

3: Sometimes the decoder needs more time (or packet?) for decoding. The
results are: several INFO messages and the decode_wait value will be very
-        priv->decode_wait += WAIT_UNIT;
-        av_log(avctx, AV_LOG_INFO, "CrystalHD: No frames ready.
+        av_log(avctx, AV_LOG_VERBOSE, "CrystalHD: No frames ready.

4: The DVB stream contains valid pts. Without this part the opaque_list
will be huge.
-    if (priv->head->fake_timestamp == fake_timestamp) {
+    if (priv->head->fake_timestamp == fake_timestamp ||
+        priv->head->reordered_opaque == fake_timestamp  ) {

5: TODO: modify few comments

Test files (10,30,50 MBytes):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-CrystalHD-Fix-h264-1080i-DVB-stream-decoding.patch
Type: application/octet-stream
Size: 4517 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120419/b4a3042c/attachment.obj>

More information about the ffmpeg-devel mailing list