[FFmpeg-trac] #1035(FFplay:open): ffplay: after changing audio stream, audio video become out of sync

FFmpeg trac at avcodec.org
Thu Mar 15 01:14:12 CET 2012


#1035: ffplay: after changing audio stream, audio video become out of sync
------------------------------------+----------------------------------
             Reporter:  rlf         |                    Owner:
                 Type:  defect      |                   Status:  open
             Priority:  minor       |                Component:  FFplay
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |
------------------------------------+----------------------------------

Comment (by cus):

 Yes, exactly like reimar described. Probably the best way is to reduce the
 amount of queued audio frames, and use a similar logic to what is already
 used for the video queue:

 {{{
 diff --git a/ffplay.c b/ffplay.c
 index dc29394..ad4892c 100644
 --- a/ffplay.c
 +++ b/ffplay.c
 @@ -2605,7 +2604,7 @@ static int read_thread(void *arg)

          /* if the queue are full, no need to read more */
          if (   is->audioq.size + is->videoq.size + is->subtitleq.size >
 MAX_QUEUE_SIZE
 -            || (   (is->audioq   .size  > MIN_AUDIOQ_SIZE ||
 is->audio_stream < 0)
 +            || (   (is->audioq   .nb_packets > MIN_FRAMES ||
 is->audio_stream < 0)
                  && (is->videoq   .nb_packets > MIN_FRAMES ||
 is->video_stream < 0)
                  && (is->subtitleq.nb_packets > MIN_FRAMES ||
 is->subtitle_stream < 0))) {
              /* wait 10 ms */

 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1035#comment:9>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list