[FFmpeg-devel] [PATCH] ffplay: Fallback to dts if pts is unavailable in pkt_in_play_range calculation

Michael Niedermayer michaelni at gmx.at
Mon Feb 2 01:27:50 CET 2015


On Mon, Feb 02, 2015 at 12:23:42AM +0100, Marton Balint wrote:
> 
> On Sun, 1 Feb 2015, Michael Niedermayer wrote:
> 
> >Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> >---
> >ffplay.c |    4 +++-
> >1 file changed, 3 insertions(+), 1 deletion(-)
> >
> >diff --git a/ffplay.c b/ffplay.c
> >index 72ec35d..c112ead 100644
> >--- a/ffplay.c
> >+++ b/ffplay.c
> >@@ -2881,6 +2881,7 @@ static int read_thread(void *arg)
> >    int orig_nb_streams;
> >    SDL_mutex *wait_mutex = SDL_CreateMutex();
> >    int scan_all_pmts_set = 0;
> >+    int64_t pkt_ts;
> >
> >    memset(st_index, -1, sizeof(st_index));
> >    is->last_video_stream = is->video_stream = -1;
> >@@ -3143,8 +3144,9 @@ static int read_thread(void *arg)
> >        }
> >        /* check if packet is in play range specified by user, then queue, otherwise discard */
> >        stream_start_time = ic->streams[pkt->stream_index]->start_time;
> >+        pkt_ts = pkt->pts == AV_NOPTS_VALUE ? pkt->dts : pkt->pts;
> >        pkt_in_play_range = duration == AV_NOPTS_VALUE ||
> >-                (pkt->pts - (stream_start_time != AV_NOPTS_VALUE ? stream_start_time : 0)) *
> >+                (pkt_ts - (stream_start_time != AV_NOPTS_VALUE ? stream_start_time : 0)) *
> >                av_q2d(ic->streams[pkt->stream_index]->time_base) -
> >                (double)(start_time != AV_NOPTS_VALUE ? start_time : 0) / 1000000
> >                <= ((double)duration / 1000000);
> >-- 
> >1.7.9.5
> 
> LGTM, thanks.

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150202/de79dde9/attachment.asc>


More information about the ffmpeg-devel mailing list