[FFmpeg-cvslog] avcodec/pgssubdec: replace data_size with got_sub_ptr for better readability

Limin Wang git at videolan.org
Wed Mar 25 20:13:34 EET 2020


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Tue Mar 24 19:05:17 2020 +0800| [766888e5194d2fd4f6543c9d759cb66133274f83] | committer: Michael Niedermayer

avcodec/pgssubdec: replace data_size with got_sub_ptr for better readability

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=766888e5194d2fd4f6543c9d759cb66133274f83
---

 libavcodec/pgssubdec.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index 7fadcb8b4b..9c59a2297f 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -614,7 +614,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
     return 1;
 }
 
-static int decode(AVCodecContext *avctx, void *data, int *data_size,
+static int decode(AVCodecContext *avctx, void *data, int *got_sub_ptr,
                   AVPacket *avpkt)
 {
     const uint8_t *buf = avpkt->data;
@@ -636,7 +636,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
     if (i & 15)
         ff_dlog(avctx, "\n");
 
-    *data_size = 0;
+    *got_sub_ptr = 0;
 
     /* Ensure that we have received at a least a segment code and segment length */
     if (buf_size < 3)
@@ -676,14 +676,14 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
              */
             break;
         case DISPLAY_SEGMENT:
-            if (*data_size) {
+            if (*got_sub_ptr) {
                 av_log(avctx, AV_LOG_ERROR, "Duplicate display segment\n");
                 ret = AVERROR_INVALIDDATA;
                 break;
             }
             ret = display_end_segment(avctx, data, buf, segment_length);
             if (ret >= 0)
-                *data_size = ret;
+                *got_sub_ptr = ret;
             break;
         default:
             av_log(avctx, AV_LOG_ERROR, "Unknown subtitle segment type 0x%x, length %d\n",
@@ -693,7 +693,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
         }
         if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) {
             avsubtitle_free(data);
-            *data_size = 0;
+            *got_sub_ptr = 0;
             return ret;
         }
 



More information about the ffmpeg-cvslog mailing list