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

FFmpeg trac at avcodec.org
Mon Mar 5 02:57:11 CET 2012


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

Comment (by rlf):

 the reported symptom will not show after patching ffplay.c as such.

 {{{
 diff --git a/ffplay.c b/ffplay.c
 index 93097e1..ac31ce6 100644
 --- a/ffplay.c
 +++ b/ffplay.c
 @@ -2725,6 +2725,7 @@ static void stream_cycle_channel(VideoState *is, int
 codec_type)
      AVFormatContext *ic = is->ic;
      int start_index, stream_index;
      AVStream *st;
 +    double pos;

      if (codec_type == AVMEDIA_TYPE_VIDEO)
          start_index = is->video_stream;
 @@ -2765,8 +2766,10 @@ static void stream_cycle_channel(VideoState *is,
 int codec_type)
          }
      }
   the_end:
 +    pos = get_master_clock(is);
      stream_component_close(is, start_index);
      stream_component_open(is, stream_index);
 +    stream_seek(is, (int64_t)(pos * AV_TIME_BASE), 0, 0);
  }

 }}}

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


More information about the FFmpeg-trac mailing list