[vlc-commits] Add gui option one libav/ffmpeg flag2 parameter

Vittorio Giovara git at videolan.org
Mon Feb 11 20:58:05 CET 2013


vlc | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Mon Feb  4 18:00:21 2013 +0100| [062b886122287d8ad3ec93b3faa59808d2b1e9c7] | committer: Rémi Denis-Courmont

Add gui option one libav/ffmpeg flag2 parameter

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=062b886122287d8ad3ec93b3faa59808d2b1e9c7
---

 modules/codec/avcodec/avcodec.c |    4 ++++
 modules/codec/avcodec/avcodec.h |    3 +++
 modules/codec/avcodec/video.c   |    5 +++++
 3 files changed, 12 insertions(+)

diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index aa17d98..456a4a9 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -129,6 +129,10 @@ vlc_module_begin ()
                   SKIPLOOPF_LONGTEXT, false)
         change_safe ()
         change_integer_list( nloopf_list, nloopf_list_text )
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 41, 0 )
+    add_bool( "avcodec-ignorecrop", false, IGNORECROP_TEXT, IGNORECROP_LONGTEXT,
+        true )
+#endif
 
     add_obsolete_integer( "ffmpeg-debug" ) /* removed since 2.1.0 */
     add_integer( "avcodec-debug", 0, DEBUG_TEXT, DEBUG_LONGTEXT,
diff --git a/modules/codec/avcodec/avcodec.h b/modules/codec/avcodec/avcodec.h
index 8c8dd20..12b21d9 100644
--- a/modules/codec/avcodec/avcodec.h
+++ b/modules/codec/avcodec/avcodec.h
@@ -110,6 +110,9 @@ int ffmpeg_OpenCodec( decoder_t *p_dec );
     "Force skipping of idct to speed up decoding for frame types " \
     "(-1=None, 0=Default, 1=B-frames, 2=P-frames, 3=B+P frames, 4=all frames)." )
 
+#define IGNORECROP_TEXT N_("Discard cropping information")
+#define IGNORECROP_LONGTEXT N_("Discard internal cropping parameters (e.g. from H.264 SPS)." )
+
 #define DEBUG_TEXT N_( "Debug mask" )
 #define DEBUG_LONGTEXT N_( "Set FFmpeg debug mask" )
 
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 5595fe1..062068f 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -237,6 +237,11 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
     if( var_CreateGetBool( p_dec, "avcodec-fast" ) )
         p_sys->p_context->flags2 |= CODEC_FLAG2_FAST;
 
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 41, 0 )
+    if( var_InheritBool( p_dec, "avcodec-ignorecrop" ) )
+        p_sys->p_context->flags2 |= CODEC_FLAG2_IGNORE_CROP;
+#endif
+
     /* ***** libavcodec frame skipping ***** */
     p_sys->b_hurry_up = var_CreateGetBool( p_dec, "avcodec-hurry-up" );
 



More information about the vlc-commits mailing list