This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 3bdd895832 avcodec/lcevcdec: use a counter as timestamp instead of 
frame pts
3bdd895832 is described below

commit 3bdd895832244780c250713e49135615ac4de003
Author:     James Almer <[email protected]>
AuthorDate: Mon Aug 17 00:14:19 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Wed Aug 19 09:25:40 2026 -0300

    avcodec/lcevcdec: use a counter as timestamp instead of frame pts
    
    If the source is an elementary stream, PTS may be unset and thus
    liblcevc-dec will not be able to match nor order input raw pictures and
    enhancement payloads.
    
    Given lcevc_process() is called from the main thread in presentation order,
    a simple counter will suffice.
    
    Signed-off-by: James Almer <[email protected]>
---
 libavcodec/lcevcdec.c | 35 +++++++++++++++++++++++------------
 libavcodec/lcevcdec.h |  1 +
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/libavcodec/lcevcdec.c b/libavcodec/lcevcdec.c
index 2e16a5a627..07f3ddabde 100644
--- a/libavcodec/lcevcdec.c
+++ b/libavcodec/lcevcdec.c
@@ -144,51 +144,62 @@ static int lcevc_send_frame(FFLCEVCFrame *frame_ctx, 
const AVFrame *in)
     AVFrame *opaque;
     LCEVC_PictureHandle picture;
     LCEVC_ReturnCode res;
-    int ret = 0;
+    int ret;
 
     if (!sd || fmt == LCEVC_ColorFormat_Unknown)
         return 1;
 
-    res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, sd->data, 
sd->size);
-    if (res != LCEVC_Success)
-        return AVERROR_EXTERNAL;
+    res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, lcevc->last_pts,
+                                           sd->data, sd->size);
+    if (res != LCEVC_Success) {
+        ret = AVERROR_EXTERNAL;
+        goto end;
+    }
 
     ret = alloc_base_frame(lcevc, in, &picture);
     if (ret < 0)
-        return ret;
+        goto end;
 
     opaque = av_frame_clone(in);
     if (!opaque) {
         LCEVC_FreePicture(lcevc->decoder, picture);
-        return AVERROR(ENOMEM);
+        ret = AVERROR(ENOMEM);
+        goto end;
     }
 
     res = LCEVC_SetPictureUserData(lcevc->decoder, picture, opaque);
     if (res != LCEVC_Success) {
         LCEVC_FreePicture(lcevc->decoder, picture);
         av_frame_free(&opaque);
-        return AVERROR_EXTERNAL;
+        ret = AVERROR_EXTERNAL;
+        goto end;
     }
 
-    res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, picture, -1, opaque);
+    res = LCEVC_SendDecoderBase(lcevc->decoder, lcevc->last_pts, picture, -1, 
opaque);
     if (res != LCEVC_Success) {
         LCEVC_FreePicture(lcevc->decoder, picture);
         av_frame_free(&opaque);
-        return AVERROR_EXTERNAL;
+        ret = AVERROR_EXTERNAL;
+        goto end;
     }
 
     memset(&picture, 0, sizeof(picture));
     ret = alloc_enhanced_frame(frame_ctx, &picture);
     if (ret < 0)
-        return ret;
+        goto end;
 
     res = LCEVC_SendDecoderPicture(lcevc->decoder, picture);
     if (res != LCEVC_Success) {
         LCEVC_FreePicture(lcevc->decoder, picture);
-        return AVERROR_EXTERNAL;
+        ret = AVERROR_EXTERNAL;
+        goto end;
     }
 
-    return 0;
+    ret = 0;
+end:
+    lcevc->last_pts++;
+
+    return ret;
 }
 
 static int generate_output(FFLCEVCFrame *frame_ctx, AVFrame *out)
diff --git a/libavcodec/lcevcdec.h b/libavcodec/lcevcdec.h
index 8571a5e6ac..b53547f112 100644
--- a/libavcodec/lcevcdec.h
+++ b/libavcodec/lcevcdec.h
@@ -40,6 +40,7 @@ typedef struct FFLCEVCContext {
     struct CodedBitstreamContext *cbc;
     struct CodedBitstreamFragment *frag;
     struct AVRefStructPool *frame_pool; ///< pool of FFLCEVCFrame
+    int64_t last_pts;
     int loglevel;
     int initialized;
 } FFLCEVCContext;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to