From aff34adf1b97b5ef3f9b95d319e6a3794f7f81f3 Mon Sep 17 00:00:00 2001
From: Alexander Reshetnikov <no@email>
Date: Fri, 30 Mar 2012 16:57:41 +0000
Subject: [PATCH] Updated new ffmpeg wrapper

---
 modules/highgui/src/cap_ffmpeg_impl_v2.hpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/modules/highgui/src/cap_ffmpeg_impl_v2.hpp b/modules/highgui/src/cap_ffmpeg_impl_v2.hpp
index ab9f64835..73abb89d7 100755
--- a/modules/highgui/src/cap_ffmpeg_impl_v2.hpp
+++ b/modules/highgui/src/cap_ffmpeg_impl_v2.hpp
@@ -961,7 +961,7 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
     AVCodec *codec;
 
 
-    st = av_new_stream(oc, 0);
+    st = avformat_new_stream(oc, 0);
     if (!st) {
         CV_WARN("Could not allocate stream");
         return NULL;
@@ -1391,13 +1391,10 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
     /* set the output parameters (must be done even if no
        parameters). */
 	#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 2, 0)
-		if (av_set_parameters(oc, NULL) < 0)
-	#else
-		if (avformat_write_header(oc, NULL) < 0)
-	#endif
-        {
+        if (av_set_parameters(oc, NULL) < 0) {
         return false;
     }
+    #endif
 
 	#if FF_API_DUMP_FORMAT
 		dump_format(oc, 0, filename, 1);