[FFmpeg-cvslog] swr: use av_opt_set_int() instead of manual assignments in swr_alloc_set_opts().

Clément Bœsch git at videolan.org
Thu Nov 17 17:57:58 CET 2011


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Nov 17 11:36:14 2011 +0100| [1dbd433f0dce3440f8b7bf315c50e1420dd7ce89] | committer: Clément Bœsch

swr: use av_opt_set_int() instead of manual assignments in swr_alloc_set_opts().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1dbd433f0dce3440f8b7bf315c50e1420dd7ce89
---

 libswresample/swresample.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 6c6482a..a8576d4 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -98,12 +98,11 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
     av_opt_set_int(s, "icl", in_ch_layout,    0);
     av_opt_set_int(s, "isf", in_sample_fmt,   0);
     av_opt_set_int(s, "isr", in_sample_rate,  0);
+    av_opt_set_int(s, "tsf", AV_SAMPLE_FMT_S16, 0);
+    av_opt_set_int(s, "ich", av_get_channel_layout_nb_channels(s-> in_ch_layout), 0);
+    av_opt_set_int(s, "och", av_get_channel_layout_nb_channels(s->out_ch_layout), 0);
 
     s->channel_map = channel_map;
-    s-> in.ch_count= av_get_channel_layout_nb_channels(s-> in_ch_layout);
-    s->out.ch_count= av_get_channel_layout_nb_channels(s->out_ch_layout);
-    s->int_sample_fmt = AV_SAMPLE_FMT_S16;
-
     return s;
 }
 



More information about the ffmpeg-cvslog mailing list