[FFmpeg-devel] [PATCH 01/11] avformat/matroskaenc: don't reserve space for stream duration tags if the output is not seekable

James Almer jamrial at gmail.com
Wed Oct 5 03:23:37 EEST 2016


On 10/4/2016 9:00 PM, Michael Niedermayer wrote:
> On Mon, Oct 03, 2016 at 08:36:57PM -0300, James Almer wrote:
>> The durations are never written in that situation.
>>
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>  libavformat/matroskaenc.c    | 2 +-
>>  tests/fate/matroska.mak      | 2 +-
>>  tests/fate/wavpack.mak       | 4 ++--
>>  tests/ref/fate/binsub-mksenc | 2 +-
>>  4 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
>> index 3eeb09b..32d5dcf 100644
>> --- a/libavformat/matroskaenc.c
>> +++ b/libavformat/matroskaenc.c
>> @@ -1376,7 +1376,7 @@ static int mkv_write_tags(AVFormatContext *s)
>>          if (ret < 0) return ret;
>>      }
>>  
>> -    if (!mkv->is_live) {
>> +    if (s->pb->seekable && !mkv->is_live) {
>>          for (i = 0; i < s->nb_streams; i++) {
>>              ebml_master tag_target;
>>              ebml_master tag;
> 
> LGTM
> 
> 
>> diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
>> index 8e4a1e8..36cc779 100644
>> --- a/tests/fate/matroska.mak
>> +++ b/tests/fate/matroska.mak
>> @@ -4,6 +4,6 @@
>>  FATE_MATROSKA-$(call DEMMUX, MATROSKA, MATROSKA) += fate-matroska-remux
>>  fate-matroska-remux: CMD = md5 -i $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm -color_trc 4 -c:v copy -fflags +bitexact -strict -2 -f matroska
>>  fate-matroska-remux: CMP = oneline
>> -fate-matroska-remux: REF = f08b20b90f158a4de5a02a52c25596b9
>> +fate-matroska-remux: REF = 1040692ffdfee2428954af79a7d5d155
> 
> off topic, but storing the output files on disk and printing some
> richer information would be quite usefull to understand changes
> 
> thx

Having tests like this where a non seekable protocol is used comes in
handy. Notice how in this set these md5 tests are unaffected by most
changes precisely because the output AVIOContext is not seekable.
I guess what could be done is duplicate the tests, using both md5
protocol and framecrc output.

In any case, what happened in here is that all of them aren't writing
Duration tags with a never-updated Void element inside anymore.

Applied, thanks.

> 
> [...]
> 
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 



More information about the ffmpeg-devel mailing list