[haiku-commits] r38493 - haiku/trunk/src/add-ons/media/plugins/ffmpeg

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 1 Sep 2010 16:50:43 +0200 (CEST)

Author: stippi
Date: 2010-09-01 16:50:43 +0200 (Wed, 01 Sep 2010)
New Revision: 38493
Changeset: http://dev.haiku-os.org/changeset/38493

Modified:
   haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
   haiku/trunk/src/add-ons/media/plugins/ffmpeg/CodecTable.cpp
Log:
 * Initialize the channel mask of the media_format.
 * Enabled the DTS decoder. The codec tag is fake,
   but as long as Readers use this, it will work.
   Currently only works with the FFmpeg reader, though,
   and I tested only with matroska containers.


Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
===================================================================
--- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp     
2010-09-01 13:02:30 UTC (rev 38492)
+++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp     
2010-09-01 14:50:43 UTC (rev 38493)
@@ -447,6 +447,10 @@
                                        description.family = 
B_MISC_FORMAT_FAMILY;
                                        codecTag = 'mp4a';
                                        break;
+                               case CODEC_ID_DTS:
+                                       description.family = 
B_WAV_FORMAT_FAMILY;
+                                       codecTag = ' DTS';
+                                       break;
                                default:
                                        fprintf(stderr, "ffmpeg codecTag is 
null, codec_id "
                                                "unknown 0x%x\n", 
codecContext->codec_id);
@@ -524,12 +528,13 @@
                case B_MEDIA_RAW_AUDIO:
                        format->u.raw_audio.frame_rate = 
(float)codecContext->sample_rate;
                        format->u.raw_audio.channel_count = 
codecContext->channels;
+                       format->u.raw_audio.channel_mask = 
codecContext->channel_layout;
                        format->u.raw_audio.byte_order
                                = 
avformat_to_beos_byte_order(codecContext->sample_fmt);
                        format->u.raw_audio.format
                                = 
avformat_to_beos_format(codecContext->sample_fmt);
                        format->u.raw_audio.buffer_size = 0;
-
+                       
                        // Read one packet and mark it for later re-use. (So 
our first
                        // GetNextChunk() call does not read another packet.)
                        if (_NextPacket(true) == B_OK) {
@@ -547,8 +552,11 @@
                                = media_multi_audio_format::wildcard;
                        format->u.encoded_audio.output.frame_rate
                                = (float)codecContext->sample_rate;
+                       // Channel layout bits match in Be API and FFmpeg.
                        format->u.encoded_audio.output.channel_count
                                = codecContext->channels;
+                       format->u.encoded_audio.multi_info.channel_mask
+                               = codecContext->channel_layout;
                        format->u.encoded_audio.output.byte_order
                                = 
avformat_to_beos_byte_order(codecContext->sample_fmt);
                        format->u.encoded_audio.output.format
@@ -870,7 +878,7 @@
        }
 #else
        if (av_seek_frame(fContext, Index(), timeStamp, searchFlags) < 0) {
-               TRACE_SEEK("  av_seek_frame() failed.\n");
+               printf("  av_seek_frame() failed.\n");
                return B_ERROR;
        }
 #endif

Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/CodecTable.cpp
===================================================================
--- haiku/trunk/src/add-ons/media/plugins/ffmpeg/CodecTable.cpp 2010-09-01 
13:02:30 UTC (rev 38492)
+++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/CodecTable.cpp 2010-09-01 
14:50:43 UTC (rev 38493)
@@ -64,6 +64,9 @@
        {CODEC_ID_AC3,                  B_MEDIA_ENCODED_AUDIO,  
B_WAV_FORMAT_FAMILY,    0x2000, "AC-3"},
        {CODEC_ID_AC3,                  B_MEDIA_ENCODED_AUDIO,  
B_WAV_FORMAT_FAMILY,    '3-CA', "AC-3"},
 
+       {CODEC_ID_DTS,                  B_MEDIA_ENCODED_AUDIO,  
B_WAV_FORMAT_FAMILY,    'STD ', "DTS"},
+       {CODEC_ID_DTS,                  B_MEDIA_ENCODED_AUDIO,  
B_WAV_FORMAT_FAMILY,    ' DTS', "DTS"},
+
 #ifdef HAS_MACE_AUDIO
        {CODEC_ID_MACE3,        B_MEDIA_ENCODED_AUDIO,  
B_QUICKTIME_FORMAT_FAMILY,      'MAC3', "MACE 3:1"},
        {CODEC_ID_MACE6,        B_MEDIA_ENCODED_AUDIO,  
B_QUICKTIME_FORMAT_FAMILY,      'MAC6', "MACE 6:1"},


Other related posts:

  • » [haiku-commits] r38493 - haiku/trunk/src/add-ons/media/plugins/ffmpeg - superstippi