95 lines
3.3 KiB
Diff
95 lines
3.3 KiB
Diff
|
From ffcc1afc919f8067ebb17eeb3acd36d93019e378 Mon Sep 17 00:00:00 2001
|
||
|
From: Xiaolei Gao <xiaolei.gao@mediatek.com>
|
||
|
Date: Fri, 9 Dec 2016 15:56:05 +0800
|
||
|
Subject: [PATCH] rmdemux: add brokenupbyus bit handling for rv3040
|
||
|
|
||
|
add brokenupbyus bit handling for rv3040
|
||
|
Test: run on 2701
|
||
|
|
||
|
Signed-off-by: Xiaolei Gao <xiaolei.gao@mediatek.com>
|
||
|
CR-Id: AUTO00001774
|
||
|
---
|
||
|
gst/realmedia/rmdemux.c | 18 ++++++++++++++----
|
||
|
gst/realmedia/rmdemux.h | 1 +
|
||
|
2 files changed, 15 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/gst/realmedia/rmdemux.c b/gst/realmedia/rmdemux.c
|
||
|
index fd13dc8..f3e5ac7 100644
|
||
|
--- a/gst/realmedia/rmdemux.c
|
||
|
+++ b/gst/realmedia/rmdemux.c
|
||
|
@@ -278,7 +278,8 @@ gst_rmdemux_init (GstRMDemux * rmdemux)
|
||
|
rmdemux->audio_first_ts = 0;
|
||
|
rmdemux->video_first_ts = 0;
|
||
|
rmdemux->avsync = FALSE;
|
||
|
-
|
||
|
+ rmdemux->pkg_brokenupbyus = FALSE;
|
||
|
+
|
||
|
gst_rm_utils_run_tests ();
|
||
|
}
|
||
|
|
||
|
@@ -2316,6 +2317,12 @@ gst_rmdemux_parse_video_packet (GstRMDemux * rmdemux, GstRMDemuxStream * stream,
|
||
|
* bit 7: 1=last block in block chain
|
||
|
* bit 6: 1=short header (only one block?)
|
||
|
*/
|
||
|
+ if ((rmdemux->pkg_brokenupbyus == FALSE) && ((pkg_header & 0xc0) == 0)) {
|
||
|
+ if (((*(data + 1)) & 0x80) == 0x80) {
|
||
|
+ rmdemux->pkg_brokenupbyus = TRUE;
|
||
|
+ GST_DEBUG_OBJECT (rmdemux, "pkg_brokenupbyus=TRUE");
|
||
|
+ }
|
||
|
+ }
|
||
|
if ((pkg_header & 0xc0) == 0x40) {
|
||
|
/* skip unknown byte */
|
||
|
data++;
|
||
|
@@ -2361,14 +2368,14 @@ gst_rmdemux_parse_video_packet (GstRMDemux * rmdemux, GstRMDemuxStream * stream,
|
||
|
GST_DEBUG_OBJECT (rmdemux, "fragment size %d", fragment_size);
|
||
|
|
||
|
if (stream->fourcc == GST_RM_VDO_RV40){
|
||
|
- if (((*data) & 0x80) == 0x80){
|
||
|
+ if ((((*data) & 0x80) == 0x80) && (rmdemux->pkg_brokenupbyus == FALSE)){
|
||
|
ecc_flag = TRUE;
|
||
|
stream->ecc_count++;
|
||
|
GST_DEBUG_OBJECT (rmdemux, "RV40: stream->ecc_count: %d", stream->ecc_count);
|
||
|
}
|
||
|
}
|
||
|
else if (stream->fourcc == GST_RM_VDO_RV30){
|
||
|
- if (((*data) & 0x20) == 0x20){
|
||
|
+ if ((((*data) & 0x20) == 0x20) && (rmdemux->pkg_brokenupbyus == FALSE)){
|
||
|
ecc_flag = TRUE;
|
||
|
stream->ecc_count++;
|
||
|
GST_DEBUG_OBJECT (rmdemux, "RV30: stream->ecc_count: %d", stream->ecc_count);
|
||
|
@@ -2430,8 +2437,10 @@ gst_rmdemux_parse_video_packet (GstRMDemux * rmdemux, GstRMDemuxStream * stream,
|
||
|
*/
|
||
|
if ((stream->fourcc == GST_RM_VDO_RV40) || (stream->fourcc == GST_RM_VDO_RV30)) {
|
||
|
stream->frag_count -= stream->ecc_count;
|
||
|
+ if ((rmdemux->pkg_brokenupbyus == TRUE) && (stream->frag_count > 1)) {
|
||
|
+ stream->frag_count = 1;
|
||
|
+ }
|
||
|
}
|
||
|
-
|
||
|
header_size = 1 + (8 * (stream->frag_count));
|
||
|
|
||
|
GST_DEBUG_OBJECT (rmdemux,
|
||
|
@@ -2523,6 +2532,7 @@ gst_rmdemux_parse_video_packet (GstRMDemux * rmdemux, GstRMDemuxStream * stream,
|
||
|
GST_BUFFER_FLAG_SET (out, GST_BUFFER_FLAG_DELTA_UNIT);
|
||
|
}
|
||
|
|
||
|
+ rmdemux->pkg_brokenupbyus = FALSE;
|
||
|
ret = gst_pad_push (stream->pad, out);
|
||
|
ret = gst_flow_combiner_update_flow (rmdemux->flowcombiner, ret);
|
||
|
if (ret != GST_FLOW_OK)
|
||
|
diff --git a/gst/realmedia/rmdemux.h b/gst/realmedia/rmdemux.h
|
||
|
index eb0c588..4928ed2 100644
|
||
|
--- a/gst/realmedia/rmdemux.h
|
||
|
+++ b/gst/realmedia/rmdemux.h
|
||
|
@@ -133,6 +133,7 @@ struct _GstRMDemux {
|
||
|
int n_chunks;
|
||
|
int chunk_index;
|
||
|
|
||
|
+ gboolean pkg_brokenupbyus;
|
||
|
guint32 object_id;
|
||
|
guint32 size;
|
||
|
guint16 object_version;
|
||
|
--
|
||
|
1.9.1
|
||
|
|