Re: [FFmpeg-devel] [PATCH] avformat/dv: implement fallback in dv_extract_pack()

2014-07-17 Thread Dave Rice
On Jul 16, 2014, at 10:57 PM, Michael Niedermayer michae...@gmx.at wrote:

 Fixes Ticket2340
 Fixes Ticket2341

I tested with the samples from tickets 2340 and 2341. In both cases the patch 
fixes the originally reported issue. Thanks!
Dave Rice
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/dv: implement fallback in dv_extract_pack()

2014-07-17 Thread Michael Niedermayer
On Thu, Jul 17, 2014 at 07:37:58AM -0400, Dave Rice wrote:
 On Jul 16, 2014, at 10:57 PM, Michael Niedermayer michae...@gmx.at wrote:
 
  Fixes Ticket2340
  Fixes Ticket2341
 
 I tested with the samples from tickets 2340 and 2341. In both cases the patch 
 fixes the originally reported issue. Thanks!

applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/dv: implement fallback in dv_extract_pack()

2014-07-16 Thread Michael Niedermayer
Fixes Ticket2340
Fixes Ticket2341

Based-on mail from Dave Rice d...@dericed.com
Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 libavformat/dv.c |   43 +++
 1 file changed, 23 insertions(+), 20 deletions(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 4f7b062..1e15c08 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -72,30 +72,33 @@ static inline uint16_t dv_audio_12to16(uint16_t sample)
 return result;
 }
 
-/*
- * This is the dumbest implementation of all -- it simply looks at
- * a fixed offset and if pack isn't there -- fails. We might want
- * to have a fallback mechanism for complete search of missing packs.
- */
 static const uint8_t *dv_extract_pack(uint8_t *frame, enum dv_pack_type t)
 {
 int offs;
+int c;
 
-switch (t) {
-case dv_audio_source:
-offs = (80 * 6 + 80 * 16 * 3 + 3);
-break;
-case dv_audio_control:
-offs = (80 * 6 + 80 * 16 * 4 + 3);
-break;
-case dv_video_control:
-offs = (80 * 5 + 48 + 5);
-break;
-case dv_timecode:
-offs = (80*1 + 3 + 3);
-break;
-default:
-return NULL;
+for (c = 0; c  10; c++) {
+switch (t) {
+case dv_audio_source:
+if (c1)offs = (80 * 6 + 80 * 16 * 0 + 3 + c*12000);
+elseoffs = (80 * 6 + 80 * 16 * 3 + 3 + c*12000);
+break;
+case dv_audio_control:
+if (c1)offs = (80 * 6 + 80 * 16 * 1 + 3 + c*12000);
+elseoffs = (80 * 6 + 80 * 16 * 4 + 3 + c*12000);
+break;
+case dv_video_control:
+if (c1)offs = (80 * 3 + 8  + c*12000);
+elseoffs = (80 * 5 + 48 + 5 + c*12000);
+break;
+case dv_timecode:
+offs = (80*1 + 3 + 3);
+break;
+default:
+return NULL;
+}
+if (frame[offs] == t)
+break;
 }
 
 return frame[offs] == t ? frame[offs] : NULL;
-- 
1.7.9.5

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel