Browse code

avcodec/dvbsubdec: add some basic av_log debuging support

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/06/05 01:09:18
Showing 1 changed files
... ...
@@ -1495,6 +1495,10 @@ static int dvbsub_decode(AVCodecContext *avctx,
1495 1495
         segment_length = AV_RB16(p);
1496 1496
         p += 2;
1497 1497
 
1498
+        if (avctx->debug & FF_DEBUG_STARTCODE) {
1499
+            av_log(avctx, AV_LOG_DEBUG, "segment_type:%d page_id:%d segment_length:%d\n", segment_type, page_id, segment_length);
1500
+        }
1501
+
1498 1502
         if (p_end - p < segment_length) {
1499 1503
             av_dlog(avctx, "incomplete or broken packet");
1500 1504
             return -1;
... ...
@@ -1538,8 +1542,10 @@ static int dvbsub_decode(AVCodecContext *avctx,
1538 1538
     }
1539 1539
     // Some streams do not send a display segment but if we have all the other
1540 1540
     // segments then we need no further data.
1541
-    if (got_segment == 15 && sub)
1541
+    if (got_segment == 15 && sub) {
1542
+        av_log(avctx, AV_LOG_DEBUG, "Missing display_end_segment, emulating\n");
1542 1543
         *data_size = dvbsub_display_end_segment(avctx, p, 0, sub);
1544
+    }
1543 1545
 
1544 1546
     return p - buf;
1545 1547
 }