[FFmpeg-devel] [PATCH 2/3] avdevice/libcdio: fix AVStream.cur_dts usage

James Almer jamrial at gmail.com
Sat Jun 5 18:01:48 EEST 2021


It should not be accessed from outside of libavformat.

Signed-off-by: James Almer <jamrial at gmail.com>
---
Untested.

I'm removing the cur_dts usage from read_packet() because i don't want to add
another avpriv function just to read it, and cdio_paranoia_read() should return
NULL when there's no more data, so it's probably superfluous.

 libavdevice/libcdio.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavdevice/libcdio.c b/libavdevice/libcdio.c
index f1a1468554..dba02d4130 100644
--- a/libavdevice/libcdio.c
+++ b/libavdevice/libcdio.c
@@ -118,9 +118,6 @@ static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
     uint16_t *buf;
     char *err = NULL;
 
-    if (ctx->streams[0]->cur_dts > s->last_sector)
-        return AVERROR_EOF;
-
     buf = cdio_paranoia_read(s->paranoia, NULL);
     if (!buf)
         return AVERROR_EOF;
@@ -157,7 +154,7 @@ static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp,
     AVStream *st = ctx->streams[0];
 
     cdio_paranoia_seek(s->paranoia, timestamp, SEEK_SET);
-    st->cur_dts = timestamp;
+    avpriv_update_cur_dts(ctx, st, timestamp);
     return 0;
 }
 
-- 
2.31.1



More information about the ffmpeg-devel mailing list