[FFmpeg-devel] [PATCH] lavf/segment: fix logic for segmenting audio-only inputs

Michael Niedermayer michaelni at gmx.at
Tue Jul 3 16:58:05 CEST 2012


On Sun, Jul 01, 2012 at 06:53:19PM +0200, Stefano Sabatini wrote:
> Also add a comment for clarifying the logic.
> 
> Fix trac ticket #1290.
> ---
>  libavformat/segment.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/segment.c b/libavformat/segment.c
> index e1fcc3e..2b7c96c 100644
> --- a/libavformat/segment.c
> +++ b/libavformat/segment.c
> @@ -206,7 +206,8 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
>      int64_t end_pts = seg->recording_time * seg->number;
>      int ret;
>  
> -    if ((seg->has_video && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
> +    /* if the segment has video, *only* start a new segment with a key video frame */
> +    if (((seg->has_video && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) || !seg->has_video) &&

the first seg->has_video &&  is unneeded
otherwise LGTM

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120703/018ee887/attachment.asc>


More information about the ffmpeg-devel mailing list