diff mbox series

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

Message ID 20210605150149.2334-2-jamrial@gmail.com
State Accepted
Commit 39affa5f8e70fb364d197242a8c11703d593f012
Headers show
Series [FFmpeg-devel,1/3] avformat/utils: make ff_update_cur_dts() an avpriv function | expand


Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

James Almer June 5, 2021, 3:01 p.m. UTC
It should not be accessed from outside of libavformat.

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

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 mbox series


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;