summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-11-28 18:55:01 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-11-28 18:55:01 +0000
commit358b472aab0e2dbef15e67fbf48f298040651e55 (patch)
tree53ae6fa609f62d1d34ba3d8a5a2d46a2f8db732d /gst
parente268611ed89350024e42b1ef89601b58dc18e175 (diff)
downloadgst-plugins-bad-358b472aab0e2dbef15e67fbf48f298040651e55.tar.gz
gst-plugins-bad-358b472aab0e2dbef15e67fbf48f298040651e55.tar.bz2
gst-plugins-bad-358b472aab0e2dbef15e67fbf48f298040651e55.zip
gst/mxf/mxfdemux.c: Only try to pull the random index pack at the end of file one time and not for every single packe...
Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_pull_random_index_pack): Only try to pull the random index pack at the end of file one time and not for every single packet if it fails.
Diffstat (limited to 'gst')
-rw-r--r--gst/mxf/mxfdemux.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c
index 9814e733..691e5407 100644
--- a/gst/mxf/mxfdemux.c
+++ b/gst/mxf/mxfdemux.c
@@ -1292,9 +1292,8 @@ gst_mxf_demux_handle_header_metadata_resolve_references (GstMXFDemux * demux)
MXFMetadataEssenceContainerData, i);
for (j = 0; j < demux->content_storage.n_essence_container_data; j++) {
- if (mxf_ul_is_equal (&demux->
- content_storage.essence_container_data_uids[j],
- &data->instance_uid)) {
+ if (mxf_ul_is_equal (&demux->content_storage.
+ essence_container_data_uids[j], &data->instance_uid)) {
demux->content_storage.essence_container_data[j] = data;
break;
}
@@ -2301,7 +2300,7 @@ gst_mxf_demux_pull_random_index_pack (GstMXFDemux * demux)
if (!gst_pad_query_peer_duration (demux->sinkpad, &fmt, &filesize) ||
fmt != GST_FORMAT_BYTES || filesize == -1) {
GST_DEBUG_OBJECT (demux, "Can't query upstream size");
- return;
+ goto out;
}
g_assert (filesize > 4);
@@ -2310,7 +2309,7 @@ gst_mxf_demux_pull_random_index_pack (GstMXFDemux * demux)
gst_mxf_demux_pull_range (demux, filesize - 4, 4,
&buffer)) != GST_FLOW_OK) {
GST_DEBUG_OBJECT (demux, "Failed pulling last 4 bytes");
- return;
+ goto out;
}
pack_size = GST_READ_UINT32_BE (GST_BUFFER_DATA (buffer));
@@ -2319,17 +2318,17 @@ gst_mxf_demux_pull_random_index_pack (GstMXFDemux * demux)
if (pack_size < 20) {
GST_DEBUG_OBJECT (demux, "Too small pack size");
- return;
+ goto out;
} else if (pack_size > filesize - 20) {
GST_DEBUG_OBJECT (demux, "Too large pack size");
- return;
+ goto out;
}
if ((ret =
gst_mxf_demux_pull_range (demux, filesize - pack_size, 16,
&buffer)) != GST_FLOW_OK) {
GST_DEBUG_OBJECT (demux, "Failed pulling random index pack key");
- return;
+ goto out;
}
memcpy (&key, GST_BUFFER_DATA (buffer), 16);
@@ -2337,20 +2336,21 @@ gst_mxf_demux_pull_random_index_pack (GstMXFDemux * demux)
if (!mxf_is_random_index_pack (&key)) {
GST_DEBUG_OBJECT (demux, "No random index pack");
- return;
+ goto out;
}
if ((ret =
gst_mxf_demux_pull_klv_packet (demux, filesize - pack_size, &key,
&buffer, NULL)) != GST_FLOW_OK) {
GST_DEBUG_OBJECT (demux, "Failed pulling random index pack");
- return;
+ goto out;
}
gst_mxf_demux_handle_random_index_pack (demux, &key, buffer);
gst_buffer_unref (buffer);
+out:
if (!demux->partition_index)
demux->partition_index =
g_array_new (FALSE, FALSE, sizeof (MXFRandomIndexPackEntry));