enable feeder threads
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sun, 22 Jun 2008 01:35:43 +0000 (01:35 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sun, 22 Jun 2008 01:35:43 +0000 (01:35 +0000)
Originally committed as revision 13868 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c
libavformat/ffmdec.c
libavformat/ffmenc.c
tests/libav.regression.ref

index 8cfa7b348ed6faa979c3eaafec25a5a13dae1215..e20ac1141a3f31a759d39400876819ef3bc3c6c8 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -449,6 +449,11 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename)
         else if (st->codec->codec_type == CODEC_TYPE_VIDEO && video_stream_copy)
             st->stream_copy = 1;
 
+        if(!st->codec->thread_count)
+            st->codec->thread_count = 1;
+        if(st->codec->thread_count>1)
+            avcodec_thread_init(st->codec, st->codec->thread_count);
+
         if(st->codec->flags & CODEC_FLAG_BITEXACT)
             nopts = 1;
     }
index 37a60a55e5675c876c7622da7c72697568e318fc..8d0a39bc238ddcbfbc19eaf6be895f71cb872f88 100644 (file)
@@ -310,6 +310,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
             codec->frame_skip_cmp = get_be32(pb);
             codec->rc_buffer_aggressivity = av_int2dbl(get_be64(pb));
             codec->codec_tag = get_be32(pb);
+            codec->thread_count = get_byte(pb);
             break;
         case CODEC_TYPE_AUDIO:
             codec->sample_rate = get_be32(pb);
index 3b7c3548413b30e9370bfad0959ebcaaf58d8ba1..1a38f9937fe320d8e18db6b4f96d6d23398b6892 100644 (file)
@@ -158,6 +158,7 @@ static int ffm_write_header(AVFormatContext *s)
             put_be32(pb, codec->frame_skip_cmp);
             put_be64(pb, av_dbl2int(codec->rc_buffer_aggressivity));
             put_be32(pb, codec->codec_tag);
+            put_byte(pb, codec->thread_count);
             break;
         case CODEC_TYPE_AUDIO:
             put_be32(pb, codec->sample_rate);
index abaa82ac81cd753ff70257707eb7ddf6b79cbbac..5e4d0b46a149c636b8400c731462769afc9699fe 100644 (file)
@@ -15,7 +15,7 @@ bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg
 d6fdeb9f7083cc827f9510c6c4517dc0 *./tests/data/b-libav.swf
 335771 ./tests/data/b-libav.swf
 ./tests/data/b-libav.swf CRC=0xe14e8847
-bbdf0d67ad1035d59adc3c4cd245f3a9 *./tests/data/b-libav.ffm
+102427263dc342610721d5754fac4d87 *./tests/data/b-libav.ffm
 380928 ./tests/data/b-libav.ffm
 ./tests/data/b-libav.ffm CRC=0x2b71a386
 f8ad5bd78f4d012a8ce9570aa395ac54 *./tests/data/b-libav.flv