[vlc-devel] [PATCH] Fix wrong initialization of 'mp2v' encoder profile.

Roman Pen r.peniaev at gmail.com
Mon Nov 10 08:44:42 CET 2008


According to ffmpeg/libavcodec/mpeg12enc.c:155 (rev:2fd06be07311) 
profile and level must be inited at the same time, so, -1 will be 
returned for mp2v with width > 720 or height > 576. But, if we leave 
this fields blank (i.e. FF_PROFILE_UNKNOWN and FF_LEVEL_UNKNOWN) avcodec 
will init them correctly.

---
  modules/codec/avcodec/encoder.c |    3 ---
  1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/modules/codec/avcodec/encoder.c 
b/modules/codec/avcodec/encoder.c
index 19519a1..51a1e7f 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -428,9 +428,6 @@ int OpenEncoder( vlc_object_t *p_this )

          p_context->width = p_enc->fmt_in.video.i_width;
          p_context->height = p_enc->fmt_in.video.i_height;
-        if( p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '2', 'v')
-             && (p_context->width > 720 || p_context->height > 576) )
-            p_context->level = 4; /* High level */

          p_context->time_base.num = p_enc->fmt_in.video.i_frame_rate_base;
          p_context->time_base.den = p_enc->fmt_in.video.i_frame_rate;
--
1.5.6.5



More information about the vlc-devel mailing list