ffmpeg | branch: release/2.4 | Michael Niedermayer <michae...@gmx.at> | Mon Jun 
22 18:27:27 2015 +0200| [00772989041ad9283f1e2cdcce0a2acc838f7ada] | committer: 
Michael Niedermayer

swr: Remember previously set int_sample_format from user

Signed-off-by: Michael Niedermayer <michae...@gmx.at>
(cherry picked from commit d4325b2fea9e2f4f4a17d0b929f12425e9c39964)

Signed-off-by: Michael Niedermayer <michae...@gmx.at>

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

 libswresample/options.c             |    4 ++--
 libswresample/swresample.c          |    2 ++
 libswresample/swresample_internal.h |    1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libswresample/options.c b/libswresample/options.c
index de84672..1bc1a70 100644
--- a/libswresample/options.c
+++ b/libswresample/options.c
@@ -49,8 +49,8 @@ static const AVOption options[]={
 {"in_sample_fmt"        , "set input sample format"     , OFFSET( 
in_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1   , 
INT_MAX, PARAM},
 {"osf"                  , "set output sample format"    , 
OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
 {"out_sample_fmt"       , "set output sample format"    , 
OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
-{"tsf"                  , "set internal sample format"  , 
OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
-{"internal_sample_fmt"  , "set internal sample format"  , 
OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 
  , INT_MAX, PARAM},
+{"tsf"                  , "set internal sample format"  , 
OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , 
{.i64=AV_SAMPLE_FMT_NONE}, -1   , INT_MAX, PARAM},
+{"internal_sample_fmt"  , "set internal sample format"  , 
OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , 
{.i64=AV_SAMPLE_FMT_NONE}, -1   , INT_MAX, PARAM},
 {"icl"                  , "set input channel layout"    , 
OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0           }, 0  
  , INT64_MAX , PARAM, "channel_layout"},
 {"in_channel_layout"    , "set input channel layout"    , 
OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0           }, 0  
  , INT64_MAX , PARAM, "channel_layout"},
 {"ocl"                  , "set output channel layout"   , 
OFFSET(user_out_ch_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0           }, 0  
  , INT64_MAX , PARAM, "channel_layout"},
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 7aa0804..3e23912 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -173,6 +173,8 @@ av_cold int swr_init(struct SwrContext *s){
     s-> in_ch_layout = s-> user_in_ch_layout;
     s->out_ch_layout = s->user_out_ch_layout;
 
+    s->int_sample_fmt= s->user_int_sample_fmt;
+
     if(av_get_channel_layout_nb_channels(s-> in_ch_layout) > SWR_CH_MAX) {
         av_log(s, AV_LOG_WARNING, "Input channel layout 0x%"PRIx64" is invalid 
or unsupported.\n", s-> in_ch_layout);
         s->in_ch_layout = 0;
diff --git a/libswresample/swresample_internal.h 
b/libswresample/swresample_internal.h
index fcc63a6..f55bd9d 100644
--- a/libswresample/swresample_internal.h
+++ b/libswresample/swresample_internal.h
@@ -95,6 +95,7 @@ struct SwrContext {
     int user_used_ch_count;                         ///< User set used channel 
count
     int64_t user_in_ch_layout;                      ///< User set input 
channel layout
     int64_t user_out_ch_layout;                     ///< User set output 
channel layout
+    enum AVSampleFormat user_int_sample_fmt;        ///< User set internal 
sample format
 
     struct DitherContext dither;
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to