[FFmpeg-devel] [PATCH 2/4] Replace remaining av_new_stream() with avformat_new_stream().

Michael Niedermayer michaelni at gmx.at
Sat Nov 5 14:03:52 CET 2011


On Sat, Nov 05, 2011 at 01:30:50PM +0100, Clément Bœsch wrote:
> ---
>  doc/examples/muxing.c     |    3 ++-
>  libavdevice/dshow.c       |    3 ++-
>  libavdevice/lavfi.c       |    3 ++-
>  libavdevice/openal-dec.c  |    2 +-
>  libavformat/act.c         |    2 +-
>  libavformat/bintext.c     |    2 +-
>  libavformat/g723_1.c      |    2 +-
>  libavformat/libmodplug.c  |    4 ++--
>  libavformat/loasdec.c     |    2 +-
>  libavformat/microdvddec.c |    2 +-
>  libavformat/pmpdec.c      |    5 +++--
>  libavformat/wav.c         |    3 ++-
>  12 files changed, 19 insertions(+), 14 deletions(-)
> 
> diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
> index 0cdc895..1a78b86 100644
> --- a/doc/examples/muxing.c
> +++ b/doc/examples/muxing.c
> @@ -64,7 +64,8 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id)
>      AVCodecContext *c;
>      AVStream *st;
>  
> -    st = av_new_stream(oc, 1);
> +    st = avformat_new_stream(oc, NULL);
> +    st->id = 1;
>      if (!st) {
>          fprintf(stderr, "Could not alloc stream\n");

the if(!st) should be before the st->anything


[...]
> @@ -231,7 +231,7 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap)
>      modplug->ts_per_packet = 1000*AUDIO_PKT_SIZE / (4*44100.);
>  
>      if (modplug->video_stream) {
> -        AVStream *vst = av_new_stream(s, 1);
> +        AVStream *vst = avformat_new_stream(s, NULL);
>          if (!vst)
>              return AVERROR(ENOMEM);
>          av_set_pts_info(vst, 64, 1, 1000);

this looses a id=1

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

Those who are best at talking, realize last or never when they are wrong.
-------------- 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/20111105/2ab62b01/attachment.asc>


More information about the ffmpeg-devel mailing list