ffmpeg | branch: master | Clément Bœsch <u...@pkh.me> | Tue Sep  8 22:49:33 
2015 +0200| [9571a56009f332c3810fe70a5c5295581256e5d1] | committer: Clément 
Bœsch

avutil/opt: refactor pixel/sample fmt common case

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

 libavutil/opt.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 7a0911b..ce80de0 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1126,8 +1126,10 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
             case AV_OPT_TYPE_INT64:
             case AV_OPT_TYPE_DURATION:
             case AV_OPT_TYPE_CHANNEL_LAYOUT:
+            case AV_OPT_TYPE_PIXEL_FMT:
+            case AV_OPT_TYPE_SAMPLE_FMT:
                 write_number(s, opt, dst, 1, 1, opt->default_val.i64);
-            break;
+                break;
             case AV_OPT_TYPE_DOUBLE:
             case AV_OPT_TYPE_FLOAT: {
                 double val;
@@ -1153,12 +1155,6 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
             case AV_OPT_TYPE_VIDEO_RATE:
                 set_string_video_rate(s, opt, opt->default_val.str, dst);
                 break;
-            case AV_OPT_TYPE_PIXEL_FMT:
-                write_number(s, opt, dst, 1, 1, opt->default_val.i64);
-                break;
-            case AV_OPT_TYPE_SAMPLE_FMT:
-                write_number(s, opt, dst, 1, 1, opt->default_val.i64);
-                break;
             case AV_OPT_TYPE_BINARY:
                 set_string_binary(s, opt, opt->default_val.str, dst);
                 break;

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

Reply via email to